﻿using System;

namespace Domain.Models
{
    /// <summary>
    /// 与仓库同步的日志
    /// </summary>
    public class SyncLog : BaseEntity
    {
        /// <summary>
        /// 主键/编号
        /// </summary>
        public new int Id { get; private set; }
        /// <summary>
        /// 日志消息主体
        /// </summary>
        public string Message { get; private set; }
        private long _createDateTime = 0;
        /// <summary>
        /// 日志产生时间
        /// </summary>
        public DateTime CreateDateTime => DateTime.UtcNow.AddMilliseconds(_createDateTime);
        /// <summary>
        /// 新的日志
        /// </summary>
        /// <param name="message"></param>
        public SyncLog(string message)
        {
            Message = message ?? throw new ArgumentNullException(nameof(message));
        }
    }
}
